Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails: Remove circular require #3567

Merged
merged 1 commit into from
Apr 3, 2024
Merged

Rails: Remove circular require #3567

merged 1 commit into from
Apr 3, 2024

Conversation

marcotc
Copy link
Member

@marcotc marcotc commented Apr 2, 2024

What does this PR do?

This PR removes a few circular requires in the Rails integrations, like the following example:

from ddtrace/lib/datadog.rb:5:in  `<top (required)>'
  from ddtrace/lib/datadog.rb:5:in  `require_relative'
  from ddtrace/lib/datadog/tracing/contrib.rb:35:in  `<top (required)>'
from ddtrace/lib/datadog/tracing/contrib.rb:35:in  `require_relative'
  from ddtrace/lib/datadog/tracing/contrib/action_pack/integration.rb:6:in  `<top (required)>'
  from ddtrace/lib/datadog/tracing/contrib/action_pack/integration.rb:6:in  `require_relative'
from ddtrace/lib/datadog/tracing/contrib/rails/integration.rb:7:in  `<top (required)>'
  from ddtrace/lib/datadog/tracing/contrib/rails/integration.rb:7:in  `require_relative'
  from ddtrace/lib/datadog/tracing/contrib/rails/patcher.rb:5:in  `<top (required)>'
from ddtrace/lib/datadog/tracing/contrib/rails/patcher.rb:5:in  `require_relative'
  from ddtrace/lib/datadog/tracing/contrib/rails/framework.rb:8:in  `<top (required)>'
  from ddtrace/lib/datadog/tracing/contrib/rails/framework.rb:8:in  `require_relative'
from ddtrace/lib/datadog/tracing/contrib/active_support/integration.rb:7:in  `<top (required)>'
  from ddtrace/lib/datadog/tracing/contrib/active_support/integration.rb:7:in  `require_relative'

How to test the change?

There should be no change in behaviour as long as integration tests pass in CI.

For Datadog employees:

  • If this PR touches code that signs or publishes builds or packages, or handles
    credentials of any kind, I've requested a review from @DataDog/security-design-and-guidance.
  • This PR doesn't touch any of that.

Unsure? Have a question? Request a review!

@marcotc marcotc requested review from a team as code owners April 2, 2024 19:18
@github-actions github-actions bot added appsec Application Security monitoring product core Involves Datadog core libraries integrations Involves tracing integrations profiling Involves Datadog profiling tracing labels Apr 2, 2024
@marcotc marcotc changed the base branch from master to 2.0 April 2, 2024 19:18
@marcotc marcotc removed request for a team April 2, 2024 19:18
@marcotc marcotc changed the title rails circular Rails: Remove circular require Apr 2, 2024
@github-actions github-actions bot removed appsec Application Security monitoring product core Involves Datadog core libraries profiling Involves Datadog profiling labels Apr 2, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.11%. Comparing base (d872d68) to head (4c585a4).
Report is 8 commits behind head on 2.0.

Additional details and impacted files
@@           Coverage Diff           @@
##              2.0    #3567   +/-   ##
=======================================
  Coverage   98.11%   98.11%           
=======================================
  Files        1237     1237           
  Lines       72194    72194           
  Branches     3396     3396           
=======================================
+ Hits        70830    70832    +2     
+ Misses       1364     1362    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@marcotc marcotc merged commit bfecc43 into 2.0 Apr 3, 2024
153 checks passed
@marcotc marcotc deleted the rails-circular branch April 3, 2024 16:47
@ivoanjo
Copy link
Member

ivoanjo commented Apr 4, 2024

Would it make sense to also backport this to the 1.x branch?

@ivoanjo ivoanjo added the 2.0 label Apr 11, 2024
@ivoanjo ivoanjo added this to the 2.0.0 milestone Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0 integrations Involves tracing integrations tracing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants